﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Coroutine_和谁协同 : MonoBehaviour
{
    // Start is called before the first frame update
    private void Start()
    {
        StartCoroutine("CoroutineFun");
    }

    private void Update()
    {
        print("Update");
    }

    //和脚本声明周期协同,  update  , endoframe ,fixedupdate
    private IEnumerator CoroutineFun() //和update协同
    {
        while (true)
        {
            yield return 1;
            print("CoroutineFun");
        }
    }
}